package org.gongliang.jsmile.common;

import org.gongliang.jsmile.common.kit.ProKit;
import org.gongliang.jsmile.common.kit.web.SpringKit;

public class KConfig {

	public static KConfig me() {
		return SpringKit.getBean(KConfig.class);
	}

	private Boolean springSessionOpen = false;
	/*
	 * session 失效时间（默认为30分钟,单位：秒）
	 */
	private Integer sessionInvalidateTime = 30 * 60;
	/*
	 * 验证失效时间（默认为15分钟,单位：秒）
	 */
	private Integer sessionValidationInterval = 15 * 60;

	private String sessionCookieName = "X-AUTH-SESSION";
	private String sessionCookiePath = "/";
	private String sessionCookieDomain;
	private String schedulerName = "JSmileScheduler";

	public Boolean getSpringSessionOpen() {
		return springSessionOpen;
	}

	public Integer getSessionInvalidateTime() {
		return ProKit.getInteger("jsmile.sessionInvalidateTime", sessionInvalidateTime);
	}

	public Integer getSessionValidationInterval() {
		return ProKit.getInteger("jsmile.sessionValidationInterval", sessionValidationInterval);
	}

	public String getSessionCookieName() {
		return ProKit.getString("jsmile.sessionCookieName", sessionCookieName);
	}

	public String getSessionCookiePath() {
		return ProKit.getString("jsmile.sessionCookiePath", sessionCookiePath);
	}

	public String getSessionCookieDomain() {
		return ProKit.getString("jsmile.sessionCookieDomain", sessionCookieDomain);
	}

	public String getSchedulerName() {
		return ProKit.getString("jsmile.schedulerName", schedulerName);
	}

}
